﻿using Elsa.Persistence.EntityFramework.Core.Extensions;
using Org.BouncyCastle.Bcpg;
using System;
using System.Collections.Generic;
using TyMES.Model.BaseInformation;


namespace TyMES.PassStationCommunication;


public record Notice(string LineCode, string StationCode);

public record INotice(string LineCode, string StationCode,string type);

public class RequestPassStation
{
    public string LineCode { get; set; }
    public string StationCode { get; set; }
    public DateTime DateTime { get; set; }
    public string snNumber { get; set; }

}

public class RequestComBase<T>
{
    public string serviceId { get; set; }
    public string factoryCode { get; set; }
    public string requestTime { get; set; }
    public T data { get; set; }
}

public class ResponseComBool
{
    public bool Success { get; set; }
    public string Mesg {  get; set; }

}

public class ResponseComSN
{
    public bool Success { get; set; }
    public string SN { get; set; }
    public string OrderCode { get; set; }
    public string ScheduleCode { get; set; }
    public string MaterialCode { get; set; }
    public string MaterialName { get; set; }
    public int ScheduleQty { get; set; }
    public int FinishedCount { get; set; }
    public string Desc { get; set; }
}


public class ResponseComBase<T>
{
    public bool Success;
    public string Mesg;
    public T Data;
}

// Product001_SNCreate  request
public class SNCreateResquest
{
    public string lineCode { get; set; }
    public string orderCode { get; set; }
    public string scheduleCode { get; set; }
    public string barcodeCategory { get; set; }
    public string snQty { get; set; }
    public string stationCode { get; set; }
}

// Product001_SNCreate  response
public class SNCreateResponse
{ 
    public string barcodeCategory { get; set; }
    public string conEnd { get; set; }
    public string ehDesc { get; set; }
    public string headerLabelName { get; set; }
    public string materialNumber { get; set; }
    public string partsCode { get; set; }
    public string print { get; set; }
    public string printCounts { get; set; }
    public string printVm { get; set; }
    public string productModel { get; set; }
    public string snBarcode { get; set; }
    public string used { get; set; }
    public string vehicleModel { get; set; }
}


//Product003_PassStation request 进出站接口
public class PassStationRequest
{
    public string factoryCode { get; set; }
    public string trayNumber { get; set; }
    public string snBindState { get; set; }
    public string requestTime { get; set; }
    public string serviceId {  get; set; }
    public string userId { get; set; }
    public string userName { get; set; }
    public string timer { get; set; }
    public List<PassStationRequestSup> data { get; set; }
}
    
public class PassStationRequestSup
{
    public string lineCode { get; set; }
    public string materialCode { get; set; }
    public string materialName { get; set; }
    public string materialVersion { get; set; }
    public string operationCode { get; set; }
    public string orderCode { get; set; }
    public string passBeginTime { get; set; }
    public string passEndTime { get; set; }
    public string passStatus { get; set; }
    public string scheduleCode { get; set; }
    public string snNumber { get; set; }
    public string stationCode { get; set; }
    public int isProduct { get; set; }
    public string shipCode { get; set; }
    public string reqType { get; set; }
    public string machineCode { get; set; }
    public string TrayNumber { get; set; }
}

//Product003_PassStation response
public class PassStationResponse
{
    public string code { get; set; }
    public bool success { get; set; }
    public bool fail { get; set; }
    public string mesg { get; set; }
    public string data { get; set; }
    public DateTime time { get; set; }
}

//Product013_ScheduleInPutNumber request 投入数量查询接口
public class ScheduleInPutNumberRequest
{
    public string serviceId {  get; set; }
    public string factoryCode {  get; set; }
    public string orderNumber { get; set; }
    public string scheduleNumber { get; set; }
}

//Product013_ScheduleInPutNumber response
public class ScheduleInPutNumberResponse
{
    public string code {  set; get; }
    public List<ScheduleInPutNumberResponseSup> data { get; set; }
    public bool fail { get; set; }
    public string mesg { get; set; }
    public bool success { get; set; }
    public DateTime time { get; set; }
}

public class ScheduleInPutNumberResponseSup
{
    public int count { get; set; }
    public string materialCode { get; set; }
    public string materialName { get; set; }
    public string materialVersion { get; set; }
    public string orderNumber { get; set; }
    public string scheduleCode { get; set; }
    public string scheduleNum { get; set; }
    public string scheduleStateCode { get; set; }
    public string stationCode { get; set; }
}

//Base018_SNInfo4Package request SN信息基础数据接口
public class SNInfo4PackageRequest
{
    public string serviceId { set; get; } = "Base018_SNInfo4Package";
    public string factoryCode { set; get; } = "TH13";
    public string snNumber { set; get; }
    public string snStatus { set; get; }
}

//Base018_SNInfo4Package response
public class SNInfo4PackageResponse
{
    public string code { set; get; }
    public List<SNInfo4PackageResponseSup> data { set; get; }
    public bool fail { set; get; }
    public string mesg { set; get; }
    public bool success { set; get; }
    public DateTime time { set; get; }
}

public class SNInfo4PackageResponseSup
{
    public string curOperationCode { set; get; }
    public string lineCode { set; get; }
    public string materialCode { set; get; }
    public string materialVersion { set; get; }
    public string orderNumber { set; get; }
    public string outputTime { set; get; }
    public string scheduleCode { set; get; }
    public string snNumber { set; get; }
    public string snStatus { set; get; }
    public string snWorkStepStatus { set; get; }
    public string stationCode { set; get; }
    public string unOperationCode { set; get; }
    public string upOperationCode { set; get; }
}

//Product002_BindVehicle request 载具绑定接口
public class BindVehicleRequest
{
    public List<BindVehicleRequestSup> data { get; set; }
    public string factoryCode { get; set; }
    public string trayNumber { get; set; }
    public string snBindState { get; set; }
    public DateTime requestTime { get; set; }
    public string serviceId { get; set; }
}

public class BindVehicleRequestSup
{
    public string lineCode { get; set; }
    public string materialCode { get; set; }
    public string materialName { get; set; }
    public string materialVersion { get; set; }
    public string operationCode { get; set; }
    public string orderCode { get; set; }
    public string scheduleCode { get; set; }
    public string snNumber { get; set; }
    public string stationCode { get; set; }
    public string userId { get; set; }
    public string userName { get; set; }
}

public class BindVehicleResponse
{
    public string code { get; set; }
    public string mesg {  get; set; }
}

//Product004_MaterialBind request 物料绑定接口
public class MaterialBindRequest
{
    public string serviceId { get; set; }
    public string factoryCode { get; set; }
    public string lineCode { get; set; }
    public string requestTime { get; set; }
    public string updateTime { get; set; }
    public string mesVersion { get; set; }
    public long timer { get; set; }
    public string uuid { get; set; }
    public List<MaterialBindRequestSup> data { get; set; }
}

public class MaterialBindRequestSup
{
    public string lineCode { get; set; }//产线号
    public string stationCode { get; set; }//工位序号
    public string orderCode { get; set; }//工单编号
    public string scheduleCode { get; set; }//排程编号
    public string snNumber { get; set; }//SN号
    public string assemblyMaterialCode { get; set; }//组件物料号
    public string assemblyMaterialQty { get; set; }//组件物料数量
    public string assemblySort {  get; set; }//
    public DateTime assemblyTime { get; set; }//组装时间
    public string assemblyMaterialName { get; set; }//
    public string assemblyMaterialVersion { get; set; }
    public string assemblyMaterialSn { get; set; }
    public string materialBatchNo { get;set; }
}

//Product004_MaterialBind response
public class MaterialBindResponse
{
    public string code { get; set; }
    public bool success { get; set; }
    public bool fail { get; set; }
    public string mesg { get; set; }
    public string data { get; set; }
    public string time { get; set; }
}

//Base011_ProcessParameters request
public class ProcessParametersRequest
{
    public string serviceId { get; set; } = "Base011_ProcessParameters";
    public string factoryCode { get; set; } = "TH13";
    public string operationCode { get; set; }
}

//Base011_ProcessParameters response
public class ProcessParametersResponse
{
    public string code {  set; get; }
    public List<ProcessParametersResponseSup> data { get; set; }
    public bool fail { get; set; }
    public string mesg { get; set; }
    public bool success { get; set; }
    public DateTime time { get; set; }
}

public class ProcessParametersResponseSup
{
    public string addTime { get; set; }
    public string addUserId { get; set; }
    public string dataStatus { get; set; }
    public string describe { get; set; }
    public string editTime { get; set; }
    public string editUserId { get; set; }
    public string id { get; set; }
    public string operationCode { get; set; }
    public string operationId { get; set; }
    public string paramCode { get; set; }
    public string paramId { get; set; }
    public string paramValue { get; set; }
}

public class PassStationConvert
{

}

public record TrayBVSNResponse(string code, bool success, bool fail, string snNumber, string mesg, string Time);

public record ParaAutoBindMaterial(string lineCode, string stationCode, string SN, string AssemblyMaterialSNs);

public class BadCodeRequest
{
    public string serviceId { get; set; }
    public string factoryCode { get; set; }
    public string operationCode { get; set; }
    public DateTime updateTime { get; set; }
}

public class BadCodetResponse
{
    public string code { get; set; } 
    public List<BadCodetResponseSup> data {  get; set; }
    public bool fail { get; set; }
    public string mesg { get; set; }
    public bool success { get; set; }
    public DateTime time { get; set; }
}

public class BadCodetResponseSup
{
    public DateTime addTime { get; set; }
    public string badCode { get; set; }
    public string badName { get; set; }
    public string badTypeCode { get; set; }
    public string badTypeName { get; set; }
    public string dataSatus { get; set; }
    public DateTime editTime { get; set; }
    public string enableStatus { get; set; }
    public string factoryCode { get; set; }
    public string field1 { get; set; }
    public string field2 { get; set; }
    public string field3 { get; set; }
    public string field4 { get; set; }
    public string field5 { get; set; }
    public string operationCode { get; set; }
}

public record OperationPara(string OperationCode);